package com.mianyang.zhangsan.plugin.quartz.util;

import com.mianyang.zhangsan.model.entity.SecTask;
import com.mianyang.zhangsan.plugin.quartz.contant.QuartzConstant;
import org.quartz.JobKey;
import org.quartz.TriggerKey;

/**
 * @author jiangjr
 * @date 2022-11-24
 */
public class QuartzUtils {

    public static JobKey getJobKey(SecTask task) {
        return JobKey.jobKey(QuartzConstant.QUARTZ_NAME_PREFIX + task.getTaskId(), task.getTaskGroup());
    }

    public static TriggerKey getTriggerKey(SecTask task) {
        return TriggerKey.triggerKey(QuartzConstant.QUARTZ_NAME_PREFIX + task.getTaskId(), task.getTaskGroup());
    }
}
